package org.redis.cluster.extension;

import org.apache.commons.lang3.StringUtils;

public abstract class AbstractExtensionLoader implements ExtensionLoader {

	@Override
	public <T> T load(String name, Class<T> type, Object... parameters) {
		if(StringUtils.isBlank(name)) {
			return load(type, parameters);
		}
		
		return doLoad(name, type, parameters);
	}

	/**
	 * 
	 * @param name
	 * @param type
	 * @param parameters
	 * @return
	 */
	protected abstract <T> T doLoad(String name, Class<T> type, Object... parameters);
}